package simple;

/**
 * @author 胡宇轩
 * @Email: yuxuan.hu01@bianlifeng.com
 */
public class IntersectionOfTwoLinkedLists {
    class Solution {
        public int[] twoSum(int[] nums, int target) {
            int l = 0;
            int r = nums.length-1;
            while(l < r){
                if(nums[l] + nums[r] == target){
                    return new int[]{nums[l],nums[r]};
                }
                if(nums[l] + nums[r] < target){
                    l ++;
                }else{
                    r--;
                }
            }
            return null;
        }
    }
}
